using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._EditingTools._Conflation
{
    /// <summary>
    /// <para>Split Line By Match</para>
    /// <para>Splits input features based on matching relationships to obtain better corresponding line segmentation.</para>
    /// <para>根据匹配关系对输入特征进行拆分，以获得更好的对应线分割。</para>
    /// </summary>    
    [DisplayName("Split Line By Match")]
    public class SplitLineByMatch : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public SplitLineByMatch()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_features">
        /// <para>Input Features</para>
        /// <para>The input line features to be split. They must be prematched with the matched features.</para>
        /// <para>要分割的输入线要素。它们必须与匹配的要素进行预匹配。</para>
        /// </param>
        /// <param name="_matched_features">
        /// <para>Matched Features</para>
        /// <para>Matched features are used as reference when splitting the input features. They must be prematched with the input features.</para>
        /// <para>拆分输入要素时，将使用匹配要素作为参考。它们必须与输入要素进行预匹配。</para>
        /// </param>
        /// <param name="_in_match_table">
        /// <para>Input Match Table</para>
        /// <para>A table that includes matching information between input and matched features.</para>
        /// <para>包含输入要素和匹配要素之间的匹配信息的表。</para>
        /// </param>
        /// <param name="_out_feature_class">
        /// <para>Output Feature Class</para>
        /// <para>The output feature class containing split lines and original lines that are not split.</para>
        /// <para>包含分割线和未分割的原始线的输出要素类。</para>
        /// </param>
        /// <param name="_search_distance">
        /// <para>Search Distance</para>
        /// <para>The distance value used to determine split locations. The value must be greater than 0. If units are not specified, the units of the input will be used.</para>
        /// <para>用于确定分割位置的距离值。该值必须大于 0。如果未指定单位，则将使用输入的单位。</para>
        /// </param>
        public SplitLineByMatch(object _in_features, object _matched_features, object _in_match_table, object _out_feature_class, string? _search_distance)
        {
            this._in_features = _in_features;
            this._matched_features = _matched_features;
            this._in_match_table = _in_match_table;
            this._out_feature_class = _out_feature_class;
            this._search_distance = _search_distance;
        }
        public override string ToolboxName => "Editing Tools";

        public override string ToolName => "Split Line By Match";

        public override string CallName => "edit.SplitLineByMatch";

        public override List<string> AcceptEnvironments => ["extent", "workspace"];

        public override object[] ParameterInfo => [_in_features, _matched_features, _in_match_table, _out_feature_class, _search_distance, _in_features_as.GetGPValue(), _out_point_feature_class, _split_dangle.GetGPValue(), _min_match_group_length, _min_split_length, _split_fields];

        /// <summary>
        /// <para>Input Features</para>
        /// <para>The input line features to be split. They must be prematched with the matched features.</para>
        /// <para>要分割的输入线要素。它们必须与匹配的要素进行预匹配。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_features { get; set; }


        /// <summary>
        /// <para>Matched Features</para>
        /// <para>Matched features are used as reference when splitting the input features. They must be prematched with the input features.</para>
        /// <para>拆分输入要素时，将使用匹配要素作为参考。它们必须与输入要素进行预匹配。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Matched Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _matched_features { get; set; }


        /// <summary>
        /// <para>Input Match Table</para>
        /// <para>A table that includes matching information between input and matched features.</para>
        /// <para>包含输入要素和匹配要素之间的匹配信息的表。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Match Table")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_match_table { get; set; }


        /// <summary>
        /// <para>Output Feature Class</para>
        /// <para>The output feature class containing split lines and original lines that are not split.</para>
        /// <para>包含分割线和未分割的原始线的输出要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Feature Class")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_feature_class { get; set; }


        /// <summary>
        /// <para>Search Distance</para>
        /// <para>The distance value used to determine split locations. The value must be greater than 0. If units are not specified, the units of the input will be used.</para>
        /// <para>用于确定分割位置的距离值。该值必须大于 0。如果未指定单位，则将使用输入的单位。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Search Distance")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public string? _search_distance { get; set; }


        /// <summary>
        /// <para>Input Features In Match</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the input features in the match table are source features or target features, so the correct features will be split.</para>
        ///   <bulletList>
        ///     <bullet_item>As source features—The input features are stored as the source features in the match table. This is the default.</bullet_item><para/>
        ///     <bullet_item>As target features—The input features are stored as the target features in the match table.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定匹配表中的输入要素是源要素还是目标要素，以便分割正确的要素。</para>
        ///   <bulletList>
        ///     <bullet_item>作为源要素 - 输入要素将作为源要素存储在匹配表中。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>作为目标要素—输入要素将作为目标要素存储在匹配表中。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Features In Match")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _in_features_as_value _in_features_as { get; set; } = _in_features_as_value._AS_SOURCE;

        public enum _in_features_as_value
        {
            /// <summary>
            /// <para>As source features</para>
            /// <para>As source features—The input features are stored as the source features in the match table. This is the default.</para>
            /// <para>作为源要素 - 输入要素将作为源要素存储在匹配表中。这是默认设置。</para>
            /// </summary>
            [Description("As source features")]
            [GPEnumValue("AS_SOURCE")]
            _AS_SOURCE,

            /// <summary>
            /// <para>As target features</para>
            /// <para>As target features—The input features are stored as the target features in the match table.</para>
            /// <para>作为目标要素—输入要素将作为目标要素存储在匹配表中。</para>
            /// </summary>
            [Description("As target features")]
            [GPEnumValue("AS_TARGET")]
            _AS_TARGET,

        }

        /// <summary>
        /// <para>Output Split Points</para>
        /// <para>The output point feature class containing points that represent split locations.</para>
        /// <para>输出点要素类包含表示分割位置的点。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Split Points")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _out_point_feature_class { get; set; } = null;


        /// <summary>
        /// <para>Split dangle features</para>
        /// <para><xdoc>
        ///   <para>Specifies whether dangling lines will be split.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—Dangling lines will be split following the tool's split rules. This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—Dangling lines will not be split.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否要拆分悬空线。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 将按照工具的分割规则分割悬空线。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中 - 不会拆分悬空线。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Split dangle features")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _split_dangle_value _split_dangle { get; set; } = _split_dangle_value._true;

        public enum _split_dangle_value
        {
            /// <summary>
            /// <para>SPLIT_DANGLE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("SPLIT_DANGLE")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_SPLIT_DANGLE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_SPLIT_DANGLE")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Minimum Match Group Length</para>
        /// <para>A given match group will only participate in the splitting process if either the total length of the input features or the total length of the matched features are greater than the specified value.</para>
        /// <para>仅当输入要素的总长度或匹配要素的总长度大于指定值时，给定匹配组才会参与分割过程。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Minimum Match Group Length")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string? _min_match_group_length { get; set; } = null;


        /// <summary>
        /// <para>Minimum Split Length</para>
        /// <para>If a split will result in one or both of the split pieces being shorter than the specified value, the split will not occur.</para>
        /// <para>如果拆分将导致一个或两个拆分片段短于指定值，则不会发生拆分。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Minimum Split Length")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string? _min_split_length { get; set; } = null;


        /// <summary>
        /// <para>Split Field(s)</para>
        /// <para>A list of numeric fields from input features. Their field values will be based on the proportions of the split lines.</para>
        /// <para>输入要素中的数值字段列表。它们的字段值将基于分割线的比例。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Split Field(s)")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _split_fields { get; set; } = null;


        public SplitLineByMatch SetEnv(object extent = null, object workspace = null)
        {
            base.SetEnv(extent: extent, workspace: workspace);
            return this;
        }

    }

}